//
//  HomeModel.swift
//  BA_MARRY_SWIFT
//
//  Created by 王洋 on 2021/5/18.
//

import UIKit
import HandyJSON
import SwiftyJSON

enum Home_sectionType:Int {
    
    case Home_section_normal = 0
    
    case Home_section_recommand = 1
}

enum Home_itemType:Int {
    //banner
    case Home_itemType_bigBanner = 4
    //栅格
    case Home_itemType_gird =  9
    //组合广告
    case Home_itemType_mixGird = 50
    //icon
    case Home_itemType_icon = 6
    //组合icon
    case Home_itemType_mixIcon = 51
    //标题
    case Home_itemType_title = 7
    //严选商家
    case Home_itemType_YXStore = 13
    //小banner
    case Home_itemType_xBanner = 8
    //新人免单
    case Home_itemType_newFree = 45
    //新栅格
    case Home_itemType_newGird = 48
}

//总的首页model
class HomeModel: HandyJSON {

    var head:[HomeHeadModel]?
    var sysAdvEvent:[HomeADItemEventModel] = []
    var sysAdvTemplate:HomeCityAdvModel?
    var startpage:[HomeADItemEventModel]?

    required init(){} // 必须实现一个空的初始化方法
}

//头部model
class HomeHeadModel: HandyJSON {
    
    var advBackImg:String?
    var sysAdvEventList:[HomeADItemEventModel]?
    var titles:[String]?
    
    required init(){} // 必须实现一个空的初始化方法
}

//对应城市的广告model
class HomeCityAdvModel: HandyJSON {
    
    var admCity:String?
    var admCityId:String?
    var admCreateEndTime:String?
    var admCreateStartTime:String?
    var admCreateTime:String?
    var admCreateUser:String?
    var admHeadId:String?
    var admHeadName:String?
    var admId:String?
    var admIsDel:String?
    var admIsDisabled:String?
    var admRemark:String?
    var admShowEndtime:String?
    var admShowStartime:String?
    var admStartpageId:String?
    var admStartpageName:String?
    var admTitle:String?
    var admUpdateTime:String?
    var admUpdateUser:String?
    var nowTime:String?
    var sysAdvMoudleList : [HomeADItemModel] = [] //一组首页数据
    
    required init(){}
}

//单项广告model   一行
class HomeADItemModel: HandyJSON {
    
    var sysAdvertisement:HomeADItemInfoModel?
    var tadmId:Int?
    var adtId:Int?
    var advId:Int?
    var id:Int?
    var isDel:Int?
    var sort:Int?

    var tadmName:String?
    var advBackImg:String?

    var tadmSellerId:String?
    var tadvName:String?
    var tcreateTime:String?
    var tcreateUser:String?
    var tisDisabled:String?
    var tremark:String?
    var tupdateTime:String?
    var tupdateUser:String?
    
    //自定义字段
    var itemHeight:CGFloat?
    var photos:[String] = []
    
    required init(){}
}

//单组数据   比如一组banner
class HomeADItemInfoModel: HandyJSON {
    
    var advId:Int?
    var advIsDel:Int?
    var advIsDisabled:Int?
    var advMoudleId:Int?

    var advBackColor:String?
    var advBackImg:String?
    var advEffectiveEndTime:String?
    var advEffectiveStarTime:String?
    var advName:String?
    var createTime:String?
    var createUser:String?
    var dictionaryName:String?
    var moudleName:String?
    var remark:String?
    var updateTime:String?
    var updateUser:String?

    var sysAdvEventList:[HomeADItemEventModel] = [] //一组点击子模块   banner里面的多个点击
    var excList:[HomeADItemEventModel] = []
    
    required init(){}
}

//单个事件图片   跟点击挂钩
class HomeADItemEventModel: HandyJSON {
    
    var index:Int?
    var advId:Int?
    var eventClickId:Int?
    var eventSellerId:String?

    var eventId:String?
    var iconName:String?
    var eventClickName:String?
    var sellerName:String?
    var url:String?
    var classId:String?
    
    required init(){}
}


